<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminLoginLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_login_logs', function (Blueprint $table) {
            $table->id()->comment('后台登录记录表');
            $table->integer('system_admin_id')->comment('管理员id')->index();
            $table->string('login_ip')->comment('用户登录ip');
            $table->string('type')->comment('登录类型 PC:电脑端 APP:APP Applet:小程序 H5:H5');
            $table->string('equipment_id')->nullable()->comment('用户登录设备id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_login_logs');
    }
}
